package com.qujia.fleet.service.impl;

/**
 * @Auther: LogicQin
 * @Date: 2023/5/10 11:26
 * @Description:
 */



import com.qujia.fleet.domain.FleetInfo;
import com.qujia.fleet.mapper.FleetInfoMapper;
import com.qujia.fleet.service.FleetInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FleetInfoServiceImpl implements FleetInfoService {
    private final FleetInfoMapper fleetInfoMapper;

    @Autowired
    public FleetInfoServiceImpl(FleetInfoMapper fleetInfoMapper) {
        this.fleetInfoMapper = fleetInfoMapper;
    }

    @Override
    public void updateFleet(FleetInfo fleetInfo) {
        fleetInfoMapper.updateFleet(fleetInfo);
    }

    @Override
    public void deleteFleetById(Integer id) {
        fleetInfoMapper.deleteFleetById(id);
    }

    @Override
    public void deleteFleetByIds(List<Integer> ids) {
        fleetInfoMapper.deleteFleetByIds(ids);
    }

    @Override
    public List<FleetInfo> getAllFleets(FleetInfo fleetInfo) {
        return fleetInfoMapper.selectAllFleets(fleetInfo);
    }

    @Override
    public FleetInfo getFleetInfoById(Integer id) {
        return fleetInfoMapper.selectFleetInfoById(id);
    }

    @Override
    public void createFleet(FleetInfo fleetInfo) {
        fleetInfoMapper.insertFleet(fleetInfo);
    }
}

